﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using Windows.ApplicationModel.Resources.Core;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Media.Imaging;

// The data model defined by this file serves as a representative example of a strongly-typed
// model that supports notification when members are added, removed, or modified.  The property
// names chosen coincide with data bindings in the standard item templates.
//
// Applications may use this model as a starting point and build on it, or discard it entirely and
// replace it with something appropriate to their needs.

namespace Cariwisata.Data
{
    public class GalleryImage : Cariwisata.Common.BindableBase
    {
        public GalleryImage(ImageSource imageSource)
        {
            this.Image = imageSource;
        }

        private ImageSource _image = null;
        public ImageSource Image
        {
            get
            {
                return this._image;
            }
            set
            {
                this._image = value;
            }
        }
    }

    public class BindableString : Cariwisata.Common.BindableBase
    {
        public BindableString(string val)
        {
            this.Value = val;
        }

        private string _value = String.Empty;
        public string Value
        {
            get
            {
                return this._value;
            }
            set
            {
                this.SetProperty(ref this._value, value);
            }
        }
    }

    public class HotelInfo : Cariwisata.Common.BindableBase
    {
        public HotelInfo(string name, string link, string address, string contact)
        {
            this.Image = imageSource;
            this.Name = name;
            this.Link = link;
            this.Address = address;
            this.Contact = contact;
			this.ImageSource = new BitmapImage(new Uri("ms-appx:///Images/Hotel/" + name + ".jpg"));
        }

        private string _link;
        public string Link
        {
            get 
            { 
                return this._link; 
            }
            set
            {
                this.SetProperty(ref this._link, value);
            }
        }

        private string _name;
        public string Name
        {
            get
            {
                return this._name;
            }
            set
            {
                this.SetProperty(ref this._name, value);
            }
        }

        private string _address;
        public string Address
        {
            get
            {
                return this._address;
            }
            set
            {
                this.SetProperty(ref this._address, value);
            }
        }

        private string _contact;
        public string Contact
        {
            get
            {
                return this._contact;
            }
            set
            {
                this.SetProperty(ref this._contact, value);
            }
        }

        private ImageSource _image = null;
        public ImageSource Image
        {
            get
            {
                return this._image;
            }
            set
            {
                this._image = value;
            }
        }
    }

    public class TravelInfo : Cariwisata.Common.BindableBase
    {
        public TravelInfo(ImageSource imageSource, string name, string link, string desc)
        {
            this.Name = name;
            this.Image = imageSource;
            this.Link = link;
            this.Desc = desc;
        }

        private string _name;
        public string Name
        {
            get
            {
                return this._name;
            }
            set
            {
                this.SetProperty(ref this._name, value);
            }
        }

        private string _link;
        public string Link
        {
            get
            {
                return this._link;
            }
            set
            {
                this.SetProperty(ref this._link, value);
            }
        }

        private string _desc;
        public string Desc
        {
            get
            {
                return this._desc;
            }
            set
            {
                this.SetProperty(ref this._desc, value);
            }
        }

        private ImageSource _image = null;
        public ImageSource Image
        {
            get
            {
                return this._image;
            }
            set
            {
                this._image = value;
            }
        }
    }

    public class EventInfo : Cariwisata.Common.BindableBase
    {
        public EventInfo(ImageSource imageSource, string name, string desc)
        {
            this.Image = imageSource;
            this.Name = name;
            this.Desc = desc;
        }

        private string _name;
        public string Name
        {
            get
            {
                return this._name;
            }
            set
            {
                this.SetProperty(ref this._name, value);
            }
        }

        private string _desc;
        public string Desc
        {
            get
            {
                return this._desc;
            }
            set
            {
                this.SetProperty(ref this._desc, value);
            }
        }

        private ImageSource _image = null;
        public ImageSource Image
        {
            get
            {
                return this._image;
            }
            set
            {
                this._image = value;
            }
        }
    }

    public class FoodInfo : Cariwisata.Common.BindableBase
    {
        public FoodInfo(ImageSource imageSource, string name, string desc)
        {
            this.OtherFoods = new ObservableCollection<BindableString>();
            this.Image = imageSource;
            this.Name = name;
            this.Desc = desc;
        }

        private ImageSource _image = null;
        public ImageSource Image
        {
            get
            {
                return this._image;
            }
            set
            {
                this._image = value;
            }
        }

        private string _name = String.Empty;
        public string Name
        {
            get
            {
                return this._name;
            }
            set
            {
                this._name = value;
            }
        }

        private string _desc = String.Empty;
        public string Desc
        {
            get
            {
                return this._desc;
            }
            set
            {
                this._desc = value;
            }
        }

        private ObservableCollection<BindableString> _otherFoods;
        public ObservableCollection<BindableString> OtherFoods
        {
            get
            {
                return this._otherFoods;
            }
            set
            {
                this._otherFoods = value;
            }
        }
    }

    public class Achievement : Cariwisata.Common.BindableBase
    {
        public Achievement(string title, string pertanyaan, string jawaban, bool status)
        {
            this.Opsi = new ObservableCollection<BindableString>();
            this.Title = title;
            this.Pertanyaan = pertanyaan;
            this.Status = status;
            this.Jawaban = jawaban;
        }

        private bool _status = false;
        private ObservableCollection<BindableString> _opsi = null;
        private string _jawaban = String.Empty;
        private string _pertanyan = String.Empty;
        private string _title;

        public bool Status
        {
            get { return this._status; }
            set
            {
                this.SetProperty(ref this._status, value);
            }
        }
        public ObservableCollection<BindableString> Opsi
        {
            get { return this._opsi; }
            set
            {
                this.SetProperty(ref this._opsi, value);
            }
        }
        public string Jawaban
        {
            get { return this._jawaban; }
            set
            {
                this.SetProperty(ref this._jawaban, value);
            }
        }
        public string Pertanyaan
        {
            get { return this._pertanyan; }
            set
            {
                this.SetProperty(ref this._pertanyan, value);
            }
        }
        public string Title
        {
            get { return this._title; }
            set
            {
                this.SetProperty(ref this._title, value);
            }
        }
    }

    public class TempatWisata : Cariwisata.Common.BindableBase
    {
        public TempatWisata(bool isVisible)
        {
            this.IsVisible = isVisible;
        }

        public TempatWisata(bool status, string name, string province, int x, int y, bool isVisible)
        {
            this.Position = new Point(x, y);
            this.Status = status;
            this.IsVisible = isVisible;
            this.Name = name;
            this.Image = new BitmapImage(new Uri("ms-appx:///Images/Icon/" + this.Name + ".png"));
            this.Province = province;
            this.Achievement = new ObservableCollection<Achievement>();
        }

        private Point _position;
        private bool _isVisible = false;
        private bool _status = false;
        private ImageSource _image = null;
        private string _name = string.Empty;
        private string _province = string.Empty;
        private ObservableCollection<Achievement> _achievement = null;

        // Fungsi
        public bool UpdateStatus()
        {
            foreach (Achievement achievement in this.Achievement)
            {
                if (!achievement.Status)
                {
                    return false;
                }
            }
            this.Status = true;
            return true;
        }

        // Getter Setter
        public ObservableCollection<Achievement> Achievement
        {
            get { return this._achievement; }
            set
            {
                this.SetProperty(ref this._achievement, value);
            }
        }

        public Point Position
        {
            get { return this._position; }
            set
            {
                this.SetProperty(ref this._position, value);
            }
        }
        public bool IsVisible
        {
            get { return this._isVisible; }
            set
            {
                this.SetProperty(ref this._isVisible, value);
            }
        }
        public bool Status
        {
            get { return this._status; }
            set
            {
                this.SetProperty(ref this._status, value);
            }
        }
        public ImageSource Image
        {
            get { return this._image; }
            set
            {
                this.SetProperty(ref this._image, value);
            }
        }
        public string Name
        {
            get { return this._name; }
            set
            {
                this.SetProperty(ref this._name, value);
            }
        }
        public string Province
        {
            get { return this._province; }
            set
            {
                this.SetProperty(ref this._province, value);
            }
        }
    }

    /// <summary>
    /// Generic item data model.
    /// </summary>
    public class SampleDataItem : Cariwisata.Common.BindableBase
    {
        public SampleDataItem(string kota, string provinsi, string nama, string story, SampleDataGroup group)
        {
            this.Nama = nama;
            this.Story = story;
            this.Kota = kota;
            this.Provinsi = provinsi;
            this.TempatWisata = new ObservableCollection<TempatWisata>();
            this.HotelInfos = new ObservableCollection<HotelInfo>();
            this.TravelInfos = new ObservableCollection<TravelInfo>();
            this._images = new ObservableCollection<GalleryImage>();
            this.Group = group;
        }

        /* Constant */
        private static Uri _baseUri = new Uri("ms-appx:///");

        /* Attribute */
        private string _nama = string.Empty;
        private string _story = string.Empty;
        private string _kota = string.Empty;
        private string _provinsi = string.Empty;
        private bool _status = false;
        private ObservableCollection<GalleryImage> _images = null;
        private ObservableCollection<TempatWisata> _tempatWisata = null;
        private ImageSource _panoramaImage = null;
        private ImageSource _mapImage = null;
        private ImageSource _iconImage = null;
        private ImageSource _avatarImage = null;
        private ObservableCollection<HotelInfo> _hotelInfos;
        private ObservableCollection<TravelInfo> _travelInfos;
        private EventInfo _eventInfo;
        private FoodInfo _foodInfo;
        private SampleDataGroup _group = null;

        /* Fungsi */
        public bool UpdateStatus()
        {
            foreach (TempatWisata wisata in this.TempatWisata)
            {
                if (!wisata.Status)
                {
                    return false;
                }
            }
            this.Status = true;
            return true;
        }

        /* Getter Setter */
        public string Nama
        {
            get { return this._nama; }
            set
            {
                this.SetProperty(ref this._nama, value);
            }
        }

        public string Story
        {
            get { return this._story; }
            set
            {
                this.SetProperty(ref this._story, value);
            }
        }

        public string Kota
        {
            get { return this._kota; }
            set
            {
                this.SetProperty(ref this._kota, value);
            }
        }

        public string Provinsi
        {
            get { return this._provinsi; }
            set
            {
                this.SetProperty(ref this._provinsi, value);
            }
        }

        public bool Status
        {
            get { return this._status; }
            set
            {
                this.SetProperty(ref this._status, value);
            }
        }

        public ObservableCollection<TempatWisata> TempatWisata
        {
            get { return this._tempatWisata; }
            set
            {
                this.SetProperty(ref this._tempatWisata, value);
            }
        }

        public ObservableCollection<GalleryImage> Images
        {
            get
            {
                return this._images;
            }
            set
            {
                this.SetProperty(ref this._images, value);
            }
        }

        public ImageSource AvatarImage
        {
            get
            {
                if (this._avatarImage== null && this._nama != null)
                {
                    if (this.Status)
                    {
                        this._avatarImage = new BitmapImage(new Uri(_baseUri, "Images/Avatar/" + this._nama + ".jpg"));
                    }
                    else 
                    {
                        this._avatarImage = new BitmapImage(new Uri(_baseUri, "Images/Avatar/Hidden.jpg"));
                    }
                }
                return this._avatarImage;
            }
            set 
            {
                this.SetProperty(ref this._panoramaImage, new BitmapImage(new Uri(_baseUri, "Images/Avatar/" + this._nama + ".jpg"))); 
            }   
        }

        public ImageSource IconImage
        {
            get
            {
                if (this._iconImage == null && this._nama != null)
                {
                    this._iconImage = new BitmapImage(new Uri(_baseUri, "Images/Icon/" + this._nama + ".jpg"));
                }
                return this._iconImage;
            }
            set
            {
                this.SetProperty(ref this._iconImage, new BitmapImage(new Uri(_baseUri, "Images/Icon/" + this._nama + ".jpg")));
            }
        }

        public ImageSource MapImage
        {
            get
            {
                if (this._mapImage == null && this._nama != null)
                {
                    this._mapImage = new BitmapImage(new Uri(_baseUri, "Images/Map/" + this._nama + ".png"));
                }
                return this._mapImage;
            }
            set
            {
                this.SetProperty(ref this._mapImage, new BitmapImage(new Uri(_baseUri, "Images/Map/" + this._nama + ".png")));
            }
        }

        public ImageSource PanoramaImage
        {
            get
            {
                if (this._panoramaImage == null && this._nama != null)
                {
                    this._panoramaImage = new BitmapImage(new Uri(_baseUri, "Images/Panorama/" + this._nama + ".jpg"));
                }
                return this._panoramaImage;
            }
            set 
            {
                this.SetProperty(ref this._avatarImage, new BitmapImage(new Uri(_baseUri, "Images/Panorama/" + this._nama + ".jpg")));
            }
        }

        public ObservableCollection<HotelInfo> HotelInfos
        {
            get { return this._hotelInfos; }
            set { this.SetProperty(ref this._hotelInfos, value); }
        }

        public ObservableCollection<TravelInfo> TravelInfos
        {
            get { return this._travelInfos; }
            set { this.SetProperty(ref this._travelInfos, value); }
        }

        public EventInfo EventInfo
        {
            get { return this._eventInfo; }
            set { this.SetProperty(ref this._eventInfo, value); }
        }

        public FoodInfo FoodInfo
        {
            get { return this._foodInfo; }
            set { this.SetProperty(ref this._foodInfo, value); }
        }

        public SampleDataGroup Group
        {
            get { return this._group; }
            set { this.SetProperty(ref this._group, value); }
        }
    }

    /// <summary>
    /// Generic group data model.
    /// </summary>
    public class SampleDataGroup : Cariwisata.Common.BindableBase
    {
        public SampleDataGroup(String pulau)
        {
            this.Pulau = pulau;
        }

        /* Constant */
        private static Uri _baseUri = new Uri("ms-appx:///");

        /* Attribute */
        private string _pulau = string.Empty;
        private SampleDataItem _selectedItem = null;
        private ObservableCollection<SampleDataItem> _items = new ObservableCollection<SampleDataItem>();

        /* Getter Setter */
        public string Pulau
        {
            get { return this._pulau; }
            set
            {
                this.SetProperty(ref this._pulau, value);
            }
        }

        public SampleDataItem SelectedItem
        {
            get { return this._selectedItem; }
            set 
            { 
                this.SetProperty(ref this._selectedItem, value);
            }
        }

        public ObservableCollection<SampleDataItem> Items
        {
            get { return this._items; }
        }

        public IEnumerable<SampleDataItem> TopItems
        {
            // Provides a subset of the full items collection to bind to from a GroupedItemsPage
            // for two reasons: GridView will not virtualize large items collections, and it
            // improves the user experience when browsing through groups with large numbers of
            // items.
            //
            // A maximum of 12 items are displayed because it results in filled grid columns
            // whether there are 1, 2, 3, 4, or 6 rows displayed
            get { return this._items.Take(4); }
        }

        public void RandomSelectedItem()
        {
            Random rand = new Random();
            this.SelectedItem = this.Items[rand.Next(Items.Count)];
        }
    }

    /// <summary>
    /// Creates a collection of groups and items with hard-coded content.
    /// </summary>
    public sealed class SampleDataSource
    {
        public const int SUMATRA = 0;
        public const int JAWA = 1;
        public const int BALINUSATENGGARA = 2;
        public const int SULAWESI = 3;
        public const int IRIAN = 4;

        public static SampleDataSource _sampleDataSource = new SampleDataSource();

        private ObservableCollection<SampleDataGroup> _allGroups = new ObservableCollection<SampleDataGroup>();
        public ObservableCollection<SampleDataGroup> AllGroups
        {
            get { return this._allGroups; }
        }

        public static IEnumerable<SampleDataGroup> GetGroups(string uniqueId)
        {
            if (!uniqueId.Equals("AllGroups")) throw new ArgumentException("Only 'AllGroups' is supported as a collection of groups");
            
            return _sampleDataSource.AllGroups;
        }

        public static SampleDataGroup GetGroup(string uniqueId)
        {
            // Simple linear search is acceptable for small data sets
            var matches = _sampleDataSource.AllGroups.Where((group) => group.Pulau.Equals(uniqueId));
            if (matches.Count() == 1) return matches.First();
            return null;
        }

        public static SampleDataItem GetItem(string uniqueId)
        {
            // Simple linear search is acceptable for small data sets
            var matches = _sampleDataSource.AllGroups.SelectMany(group => group.Items).Where((item) => item.Nama.Equals(uniqueId));
            if (matches.Count() >= 1) return matches.First();
            return null;
        }

        public SampleDataSource()
        {
            SampleDataGroup sumatra = new SampleDataGroup("Sumatra");
            SampleDataItem belitung = new SampleDataItem("Tanjung Pandan", "Sumatera Selatan", "Belitung", "Bali is...", sumatra);
            TempatWisata tirta = new TempatWisata(true, "Tirta Tapta Pemali", "Sumatera Selatan", 358,209, true);
            tirta.Achievement.Add(new Achievement("Coba", "AAAAA","AAAAA", false));
            belitung.TempatWisata.Add(tirta);
			
            belitung.EventInfo = new EventInfo(new BitmapImage(new Uri("ms-appx:///Images/Icon/Bali.jpg")),"EventName","EventDesc");
            FoodInfo foodInfo = new FoodInfo(new BitmapImage(new Uri("ms-appx:///Images/Icon/Bali.jpg")), "FoodName", "FoodDesc");
            foodInfo.OtherFoods.Add(new BindableString("Samca"));
            foodInfo.OtherFoods.Add(new BindableString("Samuel"));
            belitung.FoodInfo = foodInfo;
            belitung.HotelInfos.Add(new HotelInfo(new BitmapImage(new Uri("ms-appx:///Images/Icon/Bali.jpg")), "HotelLink", "HotelName", "HotelAddress", "HotelContact"));
            belitung.HotelInfos.Add(new HotelInfo(new BitmapImage(new Uri("ms-appx:///Images/Icon/Bali.jpg")), "HotelLink2", "HotelName2", "HotelAddress2", "HotelContact2"));
            belitung.TravelInfos.Add(new TravelInfo(new BitmapImage(new Uri("ms-appx:///Images/Icon/Bali.jpg")), "TravelName1", "TravelLink1", "TravelDesc1"));
            belitung.TravelInfos.Add(new TravelInfo(new BitmapImage(new Uri("ms-appx:///Images/Icon/Bali.jpg")), "TravelName2", "TravelLink2", "TravelDesc2"));
            belitung.Images.Add(new GalleryImage(new BitmapImage(new Uri("ms-appx:///Images/Icon/Bali.jpg"))));
            belitung.Images.Add(new GalleryImage(new BitmapImage(new Uri("ms-appx:///Images/Icon/Bandung.jpg"))));
            belitung.Images.Add(new GalleryImage(new BitmapImage(new Uri("ms-appx:///Images/Icon/Belitung.jpg"))));

            TempatWisata parai = new TempatWisata(true, "Parai Tenggiri Beach", "Sumatera Selatan", 344,196, true);
			
            parai.Achievement.Add(new Achievement("Coba", "AAAAA","AAAAA", false));
            belitung.TempatWisata.Add(parai);
            TempatWisata tanjung = new TempatWisata(true, "Tanjung Pesona Beach", "Sumatera Selatan", 357,199, true);
            tanjung.Achievement.Add(new Achievement("Coba", "AAAAA","AAAAA", false));
            belitung.TempatWisata.Add(tanjung);
            sumatra.Items.Add(belitung);

            SampleDataItem toba = new SampleDataItem("Kabupaten Toba Samosir", "Sumatera Utara", "Danau Toba", "Bali is...", sumatra);
            TempatWisata samosir = new TempatWisata(true, "Samosir Island", "Sumatera Utara", 149,77, true);
            samosir.Achievement.Add(new Achievement("Coba", "AAAAA","AAAAA", false));
            toba.TempatWisata.Add(samosir);
            TempatWisata tobalake = new TempatWisata(true, "Danau Toba", "Sumatera Utara", 155,75, true);
            tobalake.Achievement.Add(new Achievement("Coba", "AAAAA","AAAAA", false));
            toba.TempatWisata.Add(tobalake);
            TempatWisata dummy = new TempatWisata(true, "dummy", "dummy", 155, 75, false);
            dummy.Achievement.Add(new Achievement("dummy", "dummy", "dummy", false));
            toba.TempatWisata.Add(dummy);
            sumatra.Items.Add(toba);

            SampleDataItem musi = new SampleDataItem("Kabupaten Musi Bayuasin", "Sumatera Selatan", "Sungai Musi", "Bali is...", sumatra);
            TempatWisata musiRiver = new TempatWisata(true, "Musi River", "Sumatera Selatan", 284, 223, true);
            musiRiver.Achievement.Add(new Achievement("Coba", "AAAAA","AAAAA", false));
            musi.TempatWisata.Add(musiRiver);
            TempatWisata dummy2 = new TempatWisata(true, "dummy", "dummy", 155, 75, false);
            dummy2.Achievement.Add(new Achievement("dummy", "dummy", "dummy", false));
            musi.TempatWisata.Add(dummy2);
            TempatWisata dummy3 = new TempatWisata(true, "dummy", "dummy", 155, 75, false);
            dummy3.Achievement.Add(new Achievement("dummy", "dummy", "dummy", false));
            musi.TempatWisata.Add(dummy3);
            sumatra.Items.Add(musi);

            SampleDataGroup jawa = new SampleDataGroup("Jawa");
            SampleDataItem yogya = new SampleDataItem("Yogyakarta", "D.I. Yogyakarta", "Yogyakarta", "Bali is...", jawa);
            TempatWisata borobudur = new TempatWisata(false, "Borobudur Temple", "D.I. Yogyakarta", 224, 225, true);
            borobudur.Achievement.Add(new Achievement("Coba", "AAAAA", "AAAAA", false));
            yogya.TempatWisata.Add(borobudur);
            TempatWisata malioboro = new TempatWisata(false, "Malioboro", "D.I. Yogyakarta", 224, 225, true);
            malioboro.Achievement.Add(new Achievement("Coba", "AAAAA", "AAAAA", false));
            yogya.TempatWisata.Add(malioboro);
            TempatWisata dummy4 = new TempatWisata(true, "dummy", "dummy", 155, 75, false);
            dummy4.Achievement.Add(new Achievement("dummy", "dummy", "dummy", false));
            yogya.TempatWisata.Add(dummy4);
            SampleDataItem bandung = new SampleDataItem("Bandung", "Bandung Barat", "Bandung", "Bali is...", jawa);
            TempatWisata tperahu = new TempatWisata(false, "Tangkuban Perahu", "Bandung Barat", 224, 225, true);
            tperahu.Achievement.Add(new Achievement("Coba", "AAAAA", "AAAAA", false));
            bandung.TempatWisata.Add(tperahu);
            TempatWisata dummy5 = new TempatWisata(true, "dummy", "dummy", 155, 75, false);
            dummy5.Achievement.Add(new Achievement("dummy", "dummy", "dummy", false));
            bandung.TempatWisata.Add(dummy5);
            TempatWisata dummy6 = new TempatWisata(true, "dummy", "dummy", 155, 75, false);
            dummy6.Achievement.Add(new Achievement("dummy", "dummy", "dummy", false));
            bandung.TempatWisata.Add(dummy6);
            SampleDataItem ujungKulon = new SampleDataItem("Serang", "Banten", "Ujung Kulon", "Bali is...", jawa);
            TempatWisata krakatau = new TempatWisata(false, "Krakatau", "Banten", 224, 225, true);
            krakatau.Achievement.Add(new Achievement("Coba", "AAAAA", "AAAAA", false));
            ujungKulon.TempatWisata.Add(krakatau);
            TempatWisata dummy7 = new TempatWisata(true, "dummy", "dummy", 155, 75, false);
            dummy7.Achievement.Add(new Achievement("dummy", "dummy", "dummy", false));
            ujungKulon.TempatWisata.Add(dummy7);
            TempatWisata dummy8 = new TempatWisata(true, "dummy", "dummy", 155, 75, false);
            dummy8.Achievement.Add(new Achievement("dummy", "dummy", "dummy", false));
            ujungKulon.TempatWisata.Add(dummy8);
            jawa.Items.Add(yogya);
            jawa.Items.Add(bandung);
            jawa.Items.Add(ujungKulon);

            SampleDataGroup baliNT = new SampleDataGroup("Bali dan Nusa Tenggara");
            SampleDataItem bali = new SampleDataItem("Denpasar", "Bali", "Bali", "Bali is...", baliNT);
            TempatWisata kuta = new TempatWisata(false, "Kuta", "Bali", 224, 225, true);
            kuta.Achievement.Add(new Achievement("Coba", "AAAAA","AAAAA", false));
            bali.TempatWisata.Add(kuta);
            TempatWisata sanur = new TempatWisata(true, "Sanur", "Bali", 240,215, true);
            sanur.Achievement.Add(new Achievement("Coba", "AAAAA","AAAAA", false));
            bali.TempatWisata.Add(sanur);
            TempatWisata puraUlun = new TempatWisata(true, "Pura ULun Danu Bratan", "Bali", 225,95, true);
            puraUlun.Achievement.Add(new Achievement("Coba", "AAAAA","AAAAA", false));
            bali.TempatWisata.Add(puraUlun);
            TempatWisata nusaDua = new TempatWisata(true, "Nusa Dua", "Bali", 235,245, true);
            nusaDua.Achievement.Add(new Achievement("Coba", "AAAAA","AAAAA", false));
            bali.TempatWisata.Add(nusaDua);

            kuta.Achievement.Add(new Achievement("Coba","Kuta adalah : ","Kuta",false));
            kuta.Achievement[0].Opsi.Add(new BindableString("Bandung"));
            kuta.Achievement[0].Opsi.Add(new BindableString("Jakarta"));
            kuta.Achievement[0].Opsi.Add(new BindableString("Kuta"));

            SampleDataItem lombok = new SampleDataItem("Mataram", "Nusa Tenggara Barat", "Lombok", "Bali is...", baliNT);
            TempatWisata gili = new TempatWisata(true, "Gili Trawangan", "Nusa Tenggara Barat", 223, 145, true);
            gili.Achievement.Add(new Achievement("Coba", "AAAAA", "AAAAA", false));
            lombok.TempatWisata.Add(gili);
            TempatWisata rinjani = new TempatWisata(true, "Mount Rinjani", "Nusa Tenggara Barat", 171,134, true);
            rinjani.Achievement.Add(new Achievement("Coba", "AAAAA","AAAAA", false));
            lombok.TempatWisata.Add(rinjani);
            TempatWisata dummy9 = new TempatWisata(true, "dummy", "dummy", 155, 75, false);
            dummy9.Achievement.Add(new Achievement("dummy", "dummy", "dummy", false));
            lombok.TempatWisata.Add(dummy9);

            SampleDataItem komodo = new SampleDataItem("Manggarai Barat", "Nusa Tenggara Timur", "Pulau Komodo", "Bali is...", baliNT);
            TempatWisata flores = new TempatWisata(true, "Flores", "Nusa Tenggara Timur", 240,122, true);
            flores.Achievement.Add(new Achievement("Coba", "AAAAA","AAAAA", false));
            komodo.TempatWisata.Add(flores);
            TempatWisata kelimutu = new TempatWisata(true, "Kelimutu Lake", "Nusa Tenggara Timur", 171, 134, true);
            kelimutu.Achievement.Add(new Achievement("Coba", "AAAAA","AAAAA", false));
            komodo.TempatWisata.Add(kelimutu);
            TempatWisata dummy10 = new TempatWisata(true, "dummy", "dummy", 155, 75, false);
            dummy10.Achievement.Add(new Achievement("dummy", "dummy", "dummy", false));
            komodo.TempatWisata.Add(dummy10);

            baliNT.Items.Add(bali);
            baliNT.Items.Add(lombok);
            baliNT.Items.Add(komodo);

            SampleDataGroup sulawesi = new SampleDataGroup("Sulawesi");
            SampleDataItem makassar = new SampleDataItem("Makassar", "Sulawesi Selatan", "Makassar", "Bali is...", sulawesi);
            TempatWisata trans = new TempatWisata(true, "Trans Studio", "Sulawesi Selatan", 331,9, true);
            trans.Achievement.Add(new Achievement("Coba", "AAAAA","AAAAA", false));
            makassar.TempatWisata.Add(trans);
            sulawesi.Items.Add(makassar);
            TempatWisata dummy11 = new TempatWisata(true, "dummy", "dummy", 155, 75, false);
            dummy11.Achievement.Add(new Achievement("dummy", "dummy", "dummy", false));
            makassar.TempatWisata.Add(dummy11);
            TempatWisata dummy12 = new TempatWisata(true, "dummy", "dummy", 155, 75, false);
            dummy12.Achievement.Add(new Achievement("dummy", "dummy", "dummy", false));
            makassar.TempatWisata.Add(dummy12);

            SampleDataItem manado = new SampleDataItem("Manado", "Sulawesi Utara", "Manado", "Bali is...", sulawesi);
            TempatWisata bunaken = new TempatWisata(true, "Bunaken", "Sulawesi Utara", 122,176, true);
            bunaken.Achievement.Add(new Achievement("Coba", "AAAAA","AAAAA", false));
            manado.TempatWisata.Add(bunaken);
            TempatWisata dummy14 = new TempatWisata(true, "dummy", "dummy", 155, 75, false);
            dummy14.Achievement.Add(new Achievement("dummy", "dummy", "dummy", false));
            manado.TempatWisata.Add(dummy14);
            TempatWisata dummy13 = new TempatWisata(true, "dummy", "dummy", 155, 75, false);
            dummy13.Achievement.Add(new Achievement("dummy", "dummy", "dummy", false));
            manado.TempatWisata.Add(dummy13);
            sulawesi.Items.Add(manado);

            SampleDataItem rantepao = new SampleDataItem("Rantepao", "Sulawesi Selatan", "Rantepao", "Bali is...", sulawesi);
            TempatWisata toraja = new TempatWisata(true, "Tana Toraja", "Sulawesi Selatan", 105,269, true);
            toraja.Achievement.Add(new Achievement("Coba", "AAAAA","AAAAA", false));
            rantepao.TempatWisata.Add(toraja);
            TempatWisata dummy15 = new TempatWisata(true, "dummy", "dummy", 155, 75, false);
            dummy15.Achievement.Add(new Achievement("dummy", "dummy", "dummy", false));
            rantepao.TempatWisata.Add(dummy15);
            TempatWisata dummy16 = new TempatWisata(true, "dummy", "dummy", 155, 75, false);
            dummy16.Achievement.Add(new Achievement("dummy", "dummy", "dummy", false));
            rantepao.TempatWisata.Add(dummy16);
            sulawesi.Items.Add(rantepao);

            SampleDataGroup irian = new SampleDataGroup("Irian");
            SampleDataItem raja = new SampleDataItem("Raja Ampat", "Papua Barat", "Raja Ampat", "Bali is...", irian);
            TempatWisata rajaAmpat = new TempatWisata(true, "Wakatobi", "Papua Barat", 275,130, true);
            rajaAmpat.Achievement.Add(new Achievement("Coba", "AAAAA","AAAAA", false));
            raja.TempatWisata.Add(rajaAmpat);
            TempatWisata dummy17 = new TempatWisata(true, "dummy", "dummy", 155, 75, false);
            dummy17.Achievement.Add(new Achievement("dummy", "dummy", "dummy", false));
            raja.TempatWisata.Add(dummy17);
            TempatWisata dummy18 = new TempatWisata(true, "dummy", "dummy", 155, 75, false);
            dummy18.Achievement.Add(new Achievement("dummy", "dummy", "dummy", false));
            raja.TempatWisata.Add(dummy18);
            irian.Items.Add(raja);

            SampleDataItem jaya = new SampleDataItem("Jayawijaya", "Papua", "Jaya Wijaya", "Bali is...", irian);
            TempatWisata jayaWijaya = new TempatWisata(true, "Jaya Wijaya", "Papua", 17,32, true);
            jayaWijaya.Achievement.Add(new Achievement("Coba", "AAAAA","AAAAA", false));
            jaya.TempatWisata.Add(jayaWijaya);
            TempatWisata dummy19 = new TempatWisata(true, "dummy", "dummy", 155, 75, false);
            dummy19.Achievement.Add(new Achievement("dummy", "dummy", "dummy", false));
            jaya.TempatWisata.Add(dummy19);
            TempatWisata dummy20 = new TempatWisata(true, "dummy", "dummy", 155, 75, false);
            dummy20.Achievement.Add(new Achievement("dummy", "dummy", "dummy", false));
            jaya.TempatWisata.Add(dummy20);
            irian.Items.Add(jaya);

            SampleDataItem balieum = new SampleDataItem("Jayawijaya", "Papua", "Baliem Valley", "Bali is...", irian);
            TempatWisata balieumValley= new TempatWisata(true, "Baliem Valley", "Papua", 228,119, true);
            balieumValley.Achievement.Add(new Achievement("Coba", "AAAAA","AAAAA", false));
            balieum.TempatWisata.Add(balieumValley);
            TempatWisata dummy21 = new TempatWisata(true, "dummy", "dummy", 155, 75, false);
            dummy21.Achievement.Add(new Achievement("dummy", "dummy", "dummy", false));
            balieum.TempatWisata.Add(dummy21);
            TempatWisata dummy22 = new TempatWisata(true, "dummy", "dummy", 155, 75, false);
            dummy22.Achievement.Add(new Achievement("dummy", "dummy", "dummy", false));
            balieum.TempatWisata.Add(dummy22);
            irian.Items.Add(balieum);

            this.AllGroups.Add(sumatra);
            this.AllGroups.Add(jawa);
            this.AllGroups.Add(baliNT);
            this.AllGroups.Add(sulawesi);
            this.AllGroups.Add(irian);
        }
    }
}
